package org.jflame.captcha.creator;

import org.jflame.captcha.Captcha;
import org.jflame.captcha.validator.Verifiable;

/**
 * 验证码生成接口
 * 
 * @author charles.zhang
 * @param <T> 验证码用于验证的属性类型
 * @param <E> 验证码用于展示的属性类型
 */
public interface CaptchaCreator<T extends Verifiable<T>,E> {

    /**
     * 生成验证码
     * 
     * @param captchaParam
     * @return
     */
    public Captcha<T,E> create();

    /**
     * 将一个字符串解析为Verifiable
     * 
     * @param verifiableString
     * @return
     */
    public T parse(String verifiableString);

}
